package study.lxy.dubbo_ecif.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import study.lxy.dubbo_api.api.ecif.CreateEcifService;
import study.lxy.dubbo_api.entity.CustInfo;
import study.lxy.dubbo_api.exception.BusiException;
import study.lxy.dubbo_ecif.mapper.CustInfoMapper;

@com.alibaba.dubbo.config.annotation.Service
@Service
public class CreateEcifServiceImpl implements CreateEcifService {

	@Autowired
	private CustInfoMapper mapper;
	@Override
	public CustInfo create(CustInfo custInfo) throws BusiException {
		// TODO Auto-generated method stub
		String ecifId = mapper.genEcifID();
//		String ecifId = "123456";
		custInfo.setEcifId(ecifId);
		mapper.insertSelective(custInfo);
		return custInfo;
	}
	@Override
	public CustInfo queryByid(String id) throws BusiException {
		// TODO Auto-generated method stub
		return mapper.selectByPrimaryKey(id);
	}
	
	

}
